package com.mxl.swagger;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author MXL
 * @date 2021/10/14
 **/
@Configuration
public class Swagger3Config {

    @Bean
    Docket docket(){
        DocumentationType documentationType;
        Docket docket = new Docket(DocumentationType.OAS_30);
        docket.select()
                //扫描哪些包
                .apis(RequestHandlerSelectors.basePackage("com.mxl.controller"))
                .build()
                .apiInfo(
                        new ApiInfoBuilder()
                                .description("跟随松哥做的SpringBoot教程")
                                .contact(new Contact("马雪良", "www.mxl.com", "1759591150@qq.com"))
                                .title("SpringBoot-Test")
                                .version("v2.2.2")
                                .build()
                );
        return docket;
    }
}
